/**
 * @file   Page.hpp
 * @author Yuan Liu <liuyuan@net.pku.edu.cn>
 * @date   Mon Jun 25 22:52:38 2007
 *
 * @brief
 *
 *
 */

#ifndef __PAGE_HPP
#define __PAGE_HPP

#include <string>
#include <vector>

class Page
{
public:
    Page();

    bool ParseHeaderInfo();
    bool ParseHyperLinks();

    int SetOrginUrl(const std::string& crUrl);
    int SetHeader(const std::string& crHeader);
    int SetContent(const std::string& crContent);

    std::string GetOrginUrl() const;
    std::string GetHeader() const;
    std::string GetContent() const;

    int  GetContentLength() const;    // 得到服务器标识的网页长度
    bool GetConnectionStatus() const; // 得到连接状态，如果是keep-alive则可以使用1.1

    std::vector<std::string> GetUrlFromPage() const;

private:
    void ParseContentLength();
    void ParseConnectionStatus();

private:
    std::string mOrginUrl;
    std::string mHeader;
    std::string mContent;

    int         mLenContent;
    bool        mConnectionStatus;

    std::vector<std::string> mUrlFromPage;
};


#endif
